﻿using DLL.Net60.AdviceLabel.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DLL.NET60.WCL.AdviceLabel
{
    /// <summary>
    /// Interaction logic for UC_AdviceLabel.xaml
    /// </summary>
    public partial class UC_AdviceLabel : UserControl
    {
        public CAdviceLabel AdviceLabel
        {
            get { return (CAdviceLabel)GetValue(AdviceLabelProperty); }
            set { SetValue(AdviceLabelProperty, value); }
        }

        // Using a DependencyProperty as the backing store for AdviceLabel.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AdviceLabelProperty =
            DependencyProperty.Register("AdviceLabel", typeof(CAdviceLabel), typeof(UC_AdviceLabel), new PropertyMetadata(new PropertyChangedCallback(AdviceLabelPropertyChangedCallback)));

        //public static readonly DependencyProperty AdviceLabelProperty =
        //DependencyProperty.Register("AdviceLabel", typeof(CAdviceLabel), typeof(UC_BottleLabel), new PropertyMetadata(UC_BottleLabel, new PropertyChangedCallback(AdviceLabelPropertyChangedCallback)));
        private static void AdviceLabelPropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs arg)
        {
            if (sender != null && sender is UC_BottleLabel)
            {
                UC_BottleLabel clock = sender as UC_BottleLabel;
                //clock.OnTimeUpdated((DateTime)arg.OldValue, (DateTime)arg.NewValue);
                // clock.
            }
        }

        public UC_AdviceLabel()
        {
            InitializeComponent();
        }
    }
}